package mcom.xmks.bluetooth.mesh.storage;

import android.os.Parcel;
import android.os.Parcelable;


import java.util.List;

public class GroupItem implements Parcelable {
    private String name;
    private int address;
    private List<String> nodeAddressItem;

    public GroupItem(String name, int address, List<String> nodeAddressItem) {
        this.name = name;
        this.address = address;
        this.nodeAddressItem = nodeAddressItem;
    }

    protected GroupItem(Parcel in) {
        name = in.readString();
        address = in.readInt();
        nodeAddressItem = in.createStringArrayList();
    }

    public String getName() {
        return name;
    }

    public int getAddress() {
        return address;
    }

    public List<String> getNodeAddressItem() {
        return nodeAddressItem;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeInt(address);
        dest.writeStringList(nodeAddressItem);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<GroupItem> CREATOR = new Creator<GroupItem>() {
        @Override
        public GroupItem createFromParcel(Parcel in) {
            return new GroupItem(in);
        }

        @Override
        public GroupItem[] newArray(int size) {
            return new GroupItem[size];
        }
    };
}
